﻿using System;

/// <summary>
/// 文件提示类
/// </summary>
public class FileMessage
{
    /// <summary>
    /// 原文件名称
    /// </summary>
    public string FileName { get; set; }

    /// <summary>
    /// 附件名称(协议或其他要进行数据库保存与模型绑定的命名)
    /// </summary>
    public string ArgumentName { get; set; }

    /// <summary>
    /// 文件大小(KB)
    /// </summary>
    public string FileSize { get; set; }

    /// <summary>
    /// -1：上传失败 0：等待上传 1：已上传
    /// </summary>
    public int FileStatus { get; set; }

    /// <summary>
    /// 上传结果
    /// </summary>
    public string UploadResult { get; set; }

    /// <summary>
    /// 上传时间
    /// </summary>
    public DateTime dateTime { get; set; }

    /// <summary>
    /// 创建实例
    /// </summary>
    /// <param name="fileName">原文件名称</param>
    /// <param name="argumentName">(新)附件名称</param>
    /// <param name="fileSize">大小</param>
    /// <param name="fileStatus">文件状态</param>
    /// <returns></returns>
    public static FileMessage CreateNew(string fileName,string argumentName,string fileSize,int fileStatus,string uploadResult,DateTime dateTime)
    {
        return new FileMessage()
        {
            FileName = fileName,
            ArgumentName = argumentName,
            FileSize = fileSize,
            FileStatus = fileStatus,
            UploadResult = uploadResult,
            dateTime = dateTime
        };
    }
}

